<?php

use yii\db\Migration;

/**
 * Class m221118_101733_rework_news_table
 */
class m221118_101733_rework_news_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->dropColumn('{{news}}', 'title');
        $this->dropColumn('{{news}}', 'alias');
        $this->dropColumn('{{news}}', 'description');
        $this->addColumn('{{news}}', 'gallery_img', $this->string(512));
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->addColumn('{{news}}', 'title', $this->string(255));
        $this->addColumn('{{news}}', 'alias', $this->string(255));
        $this->addColumn('{{news}}', 'description', $this->string(255));
        $this->dropColumn('{{news}}', 'gallery_img');
    }
}
